/**
 * @ author: 汪孟苹
 */
define([],function(){
	var tpl = {};

	// taskList
	tpl.init = function(){
		var html = "";
		html += tabs();
		return html;
	}
	// 方案，建档时供医生选择 
	tpl.init1 = function(){
		var html = "";
		html += scheme();
		return html;
	}
	// 建档
	tpl.init2 = function(){
		var html = "";
		html += archive();
		return html;
	}
	// 问卷
	tpl.treatmentTask = function(){
		var html = "";
		html += treatmentTask();
		return html;
	}
	// 问卷right
	tpl.init3 = function(){
		var html = "";
		html += right();
		return html;
	}
	// 今日门诊记录
	tpl.init4 = function(){
		var html = "";
		html += rightOutpatientRecords();
		return html;
	}

	var tabs = function(){
		return 	'<script id="tpl_specialNurse_tabs" type="text/html">'+
				'	<div class="pageTab clearfix">'+
				'		<div class="btn-toolbar" role="toolbar">'+
				'  			<div class="btn-group" role="group">'+
				'				<button type="button" seqNo="{{archive.seq_no}}" taskId="{{archive.task_id}}" class="btn btn-click">{{archive.task_name}}</button>'+
				'			</div>'+
				'			{{if patientName}}'+
				'  			<div class="btn-group btn-task-group" role="group">'+
				'				<button type="button" class="btn btn-tit">为{{patientName}}新增：</button>'+
				'   			{{each list as value i}}'+
				'				<button type="button" seqNo="{{value.seq_no}}" taskId="{{value.task_id}}" class="btn btn-click">{{value.task_name}}</button>'+
				'   			{{/each}}'+
				'			</div>'+
				'			{{/if}}'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}
	var scheme = function(){
		return 	'<script id="tpl_specialNurse_scheme" type="text/html">'+
				'	{{if list.length != 0}}'+
				'	<div class="qaCard-subtit col-sm-12 col-md-12">'+
				'		<div id="specialNurseQueueName" queueName="{{queueName}}">方案</div>'+
				'	</div>'+
				'	{{each list as value i}}'+
				'	<div class="qaCard form-group form-group-sm col-sm-6 col-md-6 grid-label-6">'+
				'		<label class="control-label">{{value.schemeBusiName}}</label>'+
				'   	<div class="control-input">'+
				'			{{if value.status=="default"}}'+
				'				<select class="form-control" name="{{value.name}}">'+
				'					{{each value.rows as item i}}'+
				'   					<option value="{{item.schemeId}}" {{if value.val == item.schemeId}}selected="selected"{{/if}}>{{item.schemeName}}</option>'+
				'					{{/each}}'+
				'				</select>'+
				'			{{else if value.status=="readonly"}}'+
				'				{{each value.rows as item i}}'+
				'					{{if value.val == item.schemeId}}'+
				'					<p class="form-control-static" name="{{value.name}}" value="{{item.schemeId}}">{{item.schemeName}}</p>'+
				'					{{/if}}'+
				'				{{/each}}'+
				'			{{else if value.status=="disabled"}}'+
				'				<select class="form-control" name="{{value.name}}" disabled>'+
				'					{{each value.rows as item i}}'+
				'   					<option value="{{item.schemeId}}">{{item.schemeName}}</option>'+
				'					{{/each}}'+
				'				</select>'+
				'			{{/if}}'+
				'		</div>'+
				'	</div>'+
				'	{{/each}}'+
				'	{{/if}}'+
				'</script>';
	}
	var archive = function(){
		return 	'<script id="tpl_specialNurse_archive" type="text/html">'+
				'	<div id="specialNurseContentTit" class="panel-heading">建档</div>'+
				'	<div class="panel-body">'+
				'		<div id="specialNurseScheme" class="clearfix form-horizontal"></div>'+
				'		<div id="specialNurseArchive" class="clearfix"></div>'+
				'	</div>'+
				'</script>';
	}
	var treatmentTask = function(){
		return 	'<script id="tpl_specialNurse_treatmentTask" type="text/html">'+
				'	<div id="specialNurseContentTit" class="panel-heading">{{defTaskRecordName}}</div>'+
				'	<div id="specialNurseContent" class="panel-body"></div>'+
				'</script>';
	}
	var right = function(){
		return 	'<script id="tpl_specialNurse_right" type="text/html">'+
				'	<div class="medical-record-wrap">'+
				'		<div class="medical-record-box">'+
				'			{{each rows as value i}}'+
				'			<div class="medical-record">'+
				'				<div class="tit">{{value.year}}</div>'+
				'				<ul>'+
				'					{{each value.yearList as item i}}'+
				'					<li>'+
				'						<span class="time">{{item.month}}<b>{{item.day}}</b></span>'+
				'						<i class="fa fa-circle color-{{item.seqNo}}" aria-hidden="true"></i>'+
				'						<div class="name-box ellipsis-1 clearfix">'+
				'							<div class="pull-left">'+
				'							{{each item.dateList as date}}'+
				'								<span class="name {{if date.active}}active{{/if}}" seqNo="{{date.seqNo}}" ptTaskId="{{date.id}}" taskId="{{date.taskId}}">{{date.taskRecordName}}</span>'+
				'							{{/each}}'+
				'							</div>'+
				'							{{if item.dateList.length > 1}}'+
				'								<i class="timeLine-fold pull-left fa fa-plus-square-o"></i>'+
				'							{{/if}}'+
				'						</div>'+
				'					</li>'+
				'					{{/each}}'+
				'				</ul>'+
				'			</div>'+
				'			{{/each}}'+
				'		</div>'+
				'	</div>'+
				'</script>';
	}
	var rightOutpatientRecords = function(){
		return 	'<script id="tpl_specialNurse_rightOutpatientRecords" type="text/html">'+
				'	{{if show}}'+
				'	<ul class="archive-right">'+
				'		{{each list as value i}}'+
				'			<li class="row {{if value.ptSchemeid == curPatient}} active{{/if}}" patientId="{{value.patientId}}" ptSchemeid="{{value.ptSchemeid}}">'+
				'				<div class="col-sm-6 ellipsis-1">{{value.patientName}}</div>'+
				'				<div class="col-sm-6 ellipsis-1 text-right">{{value.dealTime}}</div>'+
				'			</li>'+
				'		{{/each}}'+
				'	</ul>'+
				'	{{else}}'+
				'		<div class="noClinicToday">今日无门诊~！</div>'+
				'	{{/if}}'+
				'</script>';
	}

	return tpl;
});